﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MobileMake.Models.ViewData
{
    public class AppModel
    {
        private readonly Dictionary<Type, object> modelItems = new Dictionary<Type, object>();

        public void AddModelItem<T>(T modelItem) where T : class
        {
            modelItems[typeof(T)] = modelItem;
        }

        public T GetModelItem<T>() where T : class
        {
            if (modelItems.ContainsKey(typeof(T)))
                return modelItems[typeof(T)] as T;

            return null;
        }
    }
}
